func void B_AssessDamage()
{
	var C_Npc Quarho;
	var C_Npc Rhadem;
	var C_Npc gomez;
	var C_Npc corristo;
	var C_Npc rodriguez;
	var C_Npc damarok;
	var C_Npc drago;
	var C_Npc torrez;
	var C_Npc rav;
	var int sneakweaponindex;
	var C_Item OthWeap;
	var C_Npc guardex;
	Quarho = Hlp_GetNpc(NONE_ADDON_111_Quarhodron);
	Rhadem = Hlp_GetNpc(NONE_ADDON_112_Rhademes);
	gomez = Hlp_GetNpc(none_104_gomez);
	corristo = Hlp_GetNpc(none_105_corristo);
	rodriguez = Hlp_GetNpc(none_106_rodriguez);
	damarok = Hlp_GetNpc(none_107_damarok);
	drago = Hlp_GetNpc(none_108_drago);
	torrez = Hlp_GetNpc(none_109_torrez);
	if((Hlp_GetInstanceID(self) == Hlp_GetInstanceID(gomez)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(corristo)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(rodriguez)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(damarok)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(drago)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(torrez)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(Quarho)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(Rhadem)))
	{
		B_GhostSpecialDamage(other,self);
		return;
	};
	if((Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1212_dagot)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1213_morius)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1214_tegon)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1215_kelios)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1216_demos)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1217_farion)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1218_gader)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1219_narus)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1220_wakon)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_1297_stonnos)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12120_dagot)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12130_morius)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12140_tegon)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12150_kelios)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12160_demos)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12170_farion)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12180_gader)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12190_narus)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12200_wakon)) || (Hlp_GetInstanceID(self) == Hlp_GetInstanceID(dmt_12970_stonnos)))
	{
		B_GhostSpecialDamage(other,self);
	};
	B_BeliarsWeaponSpecialDamage(other,self);
	if(Npc_IsPlayer(other))
	{
		if(ATR_STAMINA > 0)
		{
			if(Npc_IsInFightMode(other,FMODE_MELEE))
			{
				if(ATR_STAMINA > MELEEWEAPONINDEX)
				{
					ATR_STAMINA = ATR_STAMINA - MELEEWEAPONINDEX;
				}
				else
				{
					ATR_STAMINA = 0;
					Print(PRINT_LOWSTAMINA);
				};
			}
			else if(Npc_IsInFightMode(other,FMODE_FIST))
			{
				if(ATR_STAMINA > 1)
				{
					ATR_STAMINA = ATR_STAMINA - 1;
				}
				else
				{
					ATR_STAMINA = 0;
					Print(PRINT_LOWSTAMINA);
				};
			}
			else if(Npc_IsInFightMode(other,FMODE_FAR))
			{
				if(ATR_STAMINA > RANGEWEAPONINDEX)
				{
					ATR_STAMINA = ATR_STAMINA - RANGEWEAPONINDEX;
				}
				else
				{
					ATR_STAMINA = 0;
					Print(PRINT_LOWSTAMINA);
				};
			};
		}
		else if(other.attribute[ATR_HITPOINTS] < (other.attribute[ATR_HITPOINTS_MAX] / 4))
		{
			Print(PRINT_VERYLOWSTAMINA_03);
			if(Npc_IsInFightMode(other,FMODE_MELEE))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - (MELEEWEAPONINDEX * 4);
			}
			else if(Npc_IsInFightMode(other,FMODE_FIST))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - 4;
			}
			else if(Npc_IsInFightMode(other,FMODE_FAR))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - (RANGEWEAPONINDEX * 4);
			};
		}
		else if(other.attribute[ATR_HITPOINTS] < (other.attribute[ATR_HITPOINTS_MAX] / 2))
		{
			Print(PRINT_VERYLOWSTAMINA_02);
			if(Npc_IsInFightMode(other,FMODE_MELEE))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - (MELEEWEAPONINDEX * 2);
			}
			else if(Npc_IsInFightMode(other,FMODE_FIST))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - 2;
			}
			else if(Npc_IsInFightMode(other,FMODE_FAR))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - (RANGEWEAPONINDEX * 2);
			};
		}
		else if(other.attribute[ATR_HITPOINTS] < other.attribute[ATR_HITPOINTS_MAX])
		{
			Print(PRINT_VERYLOWSTAMINA_01);
			if(Npc_IsInFightMode(other,FMODE_MELEE))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - MELEEWEAPONINDEX;
			}
			else if(Npc_IsInFightMode(other,FMODE_FIST))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - 1;
			}
			else if(Npc_IsInFightMode(other,FMODE_FAR))
			{
				other.attribute[ATR_HITPOINTS] = other.attribute[ATR_HITPOINTS] - RANGEWEAPONINDEX;
			};
		};
	};
	if(Npc_IsPlayer(other) && Npc_IsInFightMode(self,FMODE_NONE) && !Npc_CanSeeNpc(self,other) && (Npc_GetDistToNpc(self,other) <= PERC_DIST_ACTIVE_MAX) && (Npc_IsInFightMode(other,FMODE_MELEE) || Npc_IsInFightMode(other,FMODE_FIST) || Npc_IsInFightMode(other,FMODE_FAR)))
	{
		if(Npc_IsInFightMode(other,FMODE_MELEE) || Npc_IsInFightMode(other,FMODE_FIST))
		{
			sneakweaponindex = other.attribute[ATR_STRENGTH] + Hlp_Random(other.attribute[ATR_DEXTERITY]);
			if((self.guild != GIL_DMT) && (self.guild != GIL_BDT) && (self.aivar[AIV_DropDeadAndKill] == FALSE))
			{
				if(sneakweaponindex >= self.attribute[ATR_HITPOINTS])
				{
					if(self.aivar[AIV_VictoryXPGiven] == FALSE)
					{
						B_GivePlayerXP(self.level * XP_PER_VICTORY);
						self.aivar[AIV_VictoryXPGiven] = TRUE;
					};
					PrintScreen("Bonus auf Uberraschungsangriff!",-1,-1,FONT_Screen,3);
					self.attribute[ATR_HITPOINTS] = 1;
					AI_PlayAniBS(self,"T_STAND_2_WOUNDED",BS_UNCONSCIOUS);
					AI_StartState(self,ZS_Unconscious,0,"");
				}
				else
				{
					PrintScreen("Bonus auf Uberraschungsangriff!",-1,-1,FONT_Screen,3);
					Npc_ChangeAttribute(self,ATR_HITPOINTS,-sneakweaponindex);
				};
			}
			else if(sneakweaponindex >= self.attribute[ATR_HITPOINTS])
			{
				if(self.aivar[AIV_VictoryXPGiven] == FALSE)
				{
					B_GivePlayerXP(self.level * XP_PER_VICTORY);
					self.aivar[AIV_VictoryXPGiven] = TRUE;
				};
				PrintScreen("Bonus auf Uberraschungsangriff!",-1,-1,FONT_Screen,3);
				AI_PlayAniBS(self,"T_DEAD",BS_DEAD);
				B_Say(self,self,"$DEAD");
				self.aivar[AIV_KilledByPlayer] = TRUE;
				self.attribute[ATR_HITPOINTS] = 0;
				AI_StartState(self,ZS_Dead,0,"");
			}
			else
			{
				PrintScreen("Bonus auf Uberraschungsangriff!",-1,-1,FONT_Screen,3);
				Npc_ChangeAttribute(self,ATR_HITPOINTS,-sneakweaponindex);
			};
		}
		else if(Npc_IsInFightMode(other,FMODE_FAR))
		{
			sneakweaponindex = other.attribute[ATR_DEXTERITY] + Hlp_Random(other.attribute[ATR_DEXTERITY]);
			if(sneakweaponindex >= self.attribute[ATR_HITPOINTS])
			{
				if(self.aivar[AIV_VictoryXPGiven] == FALSE)
				{
					B_GivePlayerXP(self.level * XP_PER_VICTORY);
					self.aivar[AIV_VictoryXPGiven] = TRUE;
				};
				PrintScreen("Bonus auf Uberraschungsangriff!",-1,-1,FONT_Screen,3);
				AI_PlayAniBS(self,"T_DEAD",BS_DEAD);
				B_Say(self,self,"$DEAD");
				self.aivar[AIV_KilledByPlayer] = TRUE;
				self.attribute[ATR_HITPOINTS] = 0;
				AI_StartState(self,ZS_Dead,0,"");
			}
			else
			{
				PrintScreen("Bonus auf Uberraschungsangriff!",-1,-1,FONT_Screen,3);
				Npc_ChangeAttribute(self,ATR_HITPOINTS,-sneakweaponindex);
			};
		};
	};
	if(Npc_IsPlayer(other) && (self.guild == GIL_DMT) && (self.flags == NPC_FLAG_IMMORTAL) && ((Npc_HasItems(other,itmw_1h_blessedblack_magic) > 0) || (Npc_HasItems(other,itmw_2h_blessedblack_magic) > 0)))
	{
		if(Npc_HasItems(other,itmw_1h_blessedblack_magic) > 0)
		{
			Npc_GetInvItem(other,itmw_1h_blessedblack_magic);
		}
		else if(Npc_HasItems(other,itmw_2h_blessedblack_magic) > 0)
		{
			Npc_GetInvItem(other,itmw_2h_blessedblack_magic);
		};
		OthWeap = Npc_GetReadiedWeapon(other);
		if(Hlp_GetInstanceID(OthWeap) == Hlp_GetInstanceID(item))
		{
			self.flags = 0;
		};
	};
	if(Npc_IsPlayer(other) && (self.guild == GIL_DMT) && (self.flags == NPC_FLAG_XARADRIM) && ((Npc_HasItems(other,itmw_1h_blessedblack_magic) > 0) || (Npc_HasItems(other,itmw_2h_blessedblack_magic) > 0)))
	{
		if(Npc_HasItems(other,itmw_1h_blessedblack_magic) > 0)
		{
			Npc_GetInvItem(other,itmw_1h_blessedblack_magic);
		}
		else if(Npc_HasItems(other,itmw_2h_blessedblack_magic) > 0)
		{
			Npc_GetInvItem(other,itmw_2h_blessedblack_magic);
		};
		OthWeap = Npc_GetReadiedWeapon(other);
		if(Hlp_GetInstanceID(OthWeap) == Hlp_GetInstanceID(item))
		{
			self.flags = 0;
		};
	};
	if((STARTBIGBATTLE == TRUE) && (self.aivar[98] == TRUE) && (BIGBATTLEBACKPOSITION == FALSE) && (other.guild < GIL_SEPERATOR_HUM) && (Npc_GetDistToWP(self,"BIGFIGHT") <= 15000))
	{
		return;
	};
	if(self.aivar[AIV_ArenaFight] == AF_AFTER)
	{
		self.aivar[AIV_ArenaFight] = AF_AFTER_PLUS_DAMAGE;
	};
	if(self.aivar[AIV_EnemyOverride] == TRUE)
	{
		rav = Hlp_GetNpc(BDT_1090_Addon_Raven);
		if(Hlp_GetInstanceID(self) == Hlp_GetInstanceID(rav))
		{
			self.aivar[AIV_EnemyOverride] = FALSE;
		};
	};
	if(Npc_IsInState(self,ZS_Attack))
	{
		if(Npc_IsPlayer(other) && (self.npcType == NPCTYPE_FRIEND))
		{
			return;
		};
		if(Npc_IsPlayer(other) && (self.aivar[AIV_PARTYMEMBER] == TRUE))
		{
			return;
		};
		if(Hlp_GetInstanceID(other) != self.aivar[AIV_LASTTARGET])
		{
			if((self.aivar[AIV_HitByOtherNpc] == Hlp_GetInstanceID(other)) || (Hlp_GetInstanceID(other) != Hlp_GetInstanceID(hero)))
			{
				Npc_SetTarget(self,other);
			}
			else
			{
				self.aivar[AIV_HitByOtherNpc] = Hlp_GetInstanceID(other);
			};
		};
		return;
	};
	if(B_AssessEnemy())
	{
		return;
	};
	if(!Npc_IsPlayer(other) && (other.aivar[AIV_ATTACKREASON] == AR_NONE))
	{
		B_Attack(self,other,AR_NONE,0);
		return;
	};
	if(Npc_IsInFightMode(other,FMODE_MELEE) || Npc_IsInFightMode(other,FMODE_FIST) || Npc_IsInFightMode(other,FMODE_NONE))
	{
		if((Npc_GetAttitude(self,other) == ATT_FRIENDLY) || ((self.npcType == NPCTYPE_FRIEND) && Npc_IsPlayer(other)))
		{
			if(!Npc_IsInState(self,ZS_ReactToDamage))
			{
				Npc_ClearAIQueue(self);
				B_ClearPerceptions(self);
				AI_StartState(self,ZS_ReactToDamage,0,"");
				return;
			};
		};
	};
	B_Attack(self,other,AR_ReactToDamage,0);
};